package cn.llk.mall.service;

import cn.llk.mall.entity.GoodsEntity;
import cn.llk.mall.entity.UserEntity;
import cn.llk.mall.entity.vo.GoodsOrderVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author llk
 * @since 2021-04-20
 */
public interface GoodsService extends IService<GoodsEntity> {


    IPage<GoodsEntity> findPage(long no, long size, String goodsName, String goodsType);

    GoodsEntity checkStock(String goodsId, Integer count);


    GoodsOrderVO buy(GoodsEntity goods, Integer count, UserEntity user);

    void putInCart(String goodsId, Integer count, UserEntity user);

    GoodsOrderVO buyCart(Map<Object, Object> goodsIdMapCount, String userId);

    GoodsOrderVO getCart(Map<Object, Object> goodsIdMapCount, String userId);
}
